package com.empirisoftware.example.guice;

import com.empirisoftware.cache.conf.CacheModule;
import com.empirisoftware.datastore.conf.DAOModule;
import com.empirisoftware.logging.conf.LoggingModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;



/**
 * this context listener creates the injector with the supplied modules
 * @author cjlyth
 *
 */
public class ProjectServletContextListener extends GuiceServletContextListener {
	@Override
	protected Injector getInjector() {
		return Guice.createInjector(
				new ProjectModule(),
				new ProjectServletModule(),
				new LoggingModule(), 
				new DAOModule(),
				new CacheModule());
	}
}